export const state = () => ({
    userInfo:{}
})

export const mutations = {
    login(state, userInfo) {
        state.userInfo = userInfo;
    },
    // 退出
    logOut(state){
        state.userInfo={}
    } 
}

export const actions = {
   async login({ commit }, form) {
        const res = await this.$axios.post("/accounts/login",form)
        commit('login',res)
   } 
}